package com.sphd.beautysalon.presenter;


import com.android.volley.VolleyError;
import com.sphd.beautysalon.info.GoodInOrOutInfo;
import com.sphd.beautysalon.model.InorOutFragmentModelImpl;
import com.sphd.beautysalon.view.InorOutFragmentView;

import java.util.List;

/**
* Created by Hu on 2016/12/26
*/

public class InorOutFragmentPresenterImpl implements InorOutFragmentPresenter{
    InorOutFragmentModelImpl inorOutFragmentModel;
    InorOutFragmentView inorOutFragmentView;

    public InorOutFragmentPresenterImpl(InorOutFragmentView inorOutFragmentView) {
        this.inorOutFragmentView = inorOutFragmentView;
        inorOutFragmentModel=new InorOutFragmentModelImpl();
    }

    @Override
    public void addData(String url) {
        inorOutFragmentView.showLoading();
        inorOutFragmentModel.sendUrl(url,this);
    }

    @Override
    public void sendError(VolleyError error) {
        inorOutFragmentView.dissLoading();
    }

    @Override
    public void sendList(List<GoodInOrOutInfo> goodInOrOutInfos) {
        inorOutFragmentView.recList(goodInOrOutInfos);
        inorOutFragmentView.dissLoading();
    }
}